import request from "../utils/request"


export default{
    search(page,rows,searchMap){
        return request({
            method:"post",
            url:`/staff/search/${page}/${rows}`,
            data:{
                searchMap,
            }
        })
    },
    //新增员工
    add(staff){
        return request({
            method:"post",
            url:"/staff/add",
            data:{
                staff,
            }
        })
    },
    //回显员工信息
    getOne(id){
        return request({
            method:"get",
            url:`/staff/getOne/${id}`,
        })
    },
    //修改员工信息
    updateOne(staff){
        return request({
            method:"put",
            url:`/staff/edit/${staff.id}`,
            data:{
                staff,
            }
        })
    },
    //删除员工
    deleteOne(id){
        return request({
            method:"delete",
            url:`/staff/deleteOne/${id}`,
        })
    }
}